//
//  Train.m
//  ElektroM
//
//  Created by Michael on 14.10.09.
//  Copyright 2009 Artgruppe inc. All rights reserved.
//

#import "Train.h"


@implementation Train

@synthesize trainNumber,  startStation, endStation, sTime, nInfo;


- (UIImage *)stateImageForAtomicElementTileView {
	NSString* state=@"Liquid";
	return [UIImage imageNamed:[NSString stringWithFormat:@"%@_37.png",state]];
}


- (UIImage *)stateImageForAtomicElementView {
	NSString* state=@"Liquid";
	return [UIImage imageNamed:[NSString stringWithFormat:@"%@_256.png",state]];
}

- (UIImage *)stateImageForPeriodicTableView {
	NSString* state=@"Liquid";
	return [UIImage imageNamed:[NSString stringWithFormat:@"%@_24.png",state]];
}

- (UIImage *)flipperImageForAtomicElementNavigationItem {
	NSString* state=@"Liquid";
	// return a 30 x 30 image that is a reduced version
	// of the AtomicElementTileView content
	// this is used to display the flipper button in the navigation bar
	CGSize itemSize=CGSizeMake(30.0,30.0);
	UIGraphicsBeginImageContext(itemSize);
	
	UIImage *backgroundImage = [UIImage imageNamed:[NSString stringWithFormat:@"%@_30.png",state]];
	CGRect elementSymbolRectangle = CGRectMake(0,0, itemSize.width, itemSize.height);
	[backgroundImage drawInRect:elementSymbolRectangle];
	
	// draw the element name
	[[UIColor whiteColor] set];
	
	// draw the element number
	/*
	UIFont *font = [UIFont boldSystemFontOfSize:8];
	CGPoint point = CGPointMake(2,1);
	//[[self.atomicNumber stringValue] drawAtPoint:point withFont:font];
	
	// draw the element symbol
	font = [UIFont boldSystemFontOfSize:13];
	CGSize stringSize = [self.symbol sizeWithFont:font];
	point = CGPointMake((elementSymbolRectangle.size.width-stringSize.width)/2,10);
	
	[self.symbol drawAtPoint:point withFont:font];
	 */
	
	UIImage *theImage=UIGraphicsGetImageFromCurrentImageContext();
	UIGraphicsEndImageContext();
	return theImage;
}

@end
